﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dominio;
using Persistencia;

namespace PersistenciaImplementacion
{
    class BrokerManager
    {
        private static BrokerManager instancia = null;
        private BrokerManager() { }

        public static BrokerManager GetInstance()
        {
            if (instancia == null)
            {
                instancia = new BrokerManager();
            }
            return instancia;
        }

        public Broker GetBroker(ObjetoPersistible obj)
        {
            if (obj is Tanque)
            {
                return new BrokerTanque();
            }
            else if (obj is Cliente)
            {
                return new BrokerCliente();
            }
            else if (obj is Manguera)
            {
                return new BrokerManguera();
            }
            else if (obj is Surtidor)
            {
                return new BrokerSurtidor();
            }
            else if (obj is TareaMantenimiento)
            {
                return new BrokerTareaMantenimiento();
            }
            else if (obj is Expendido)
            {
                return new BrokerExpendido();
            }
            return null;
        }
    }
}
